home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
faq-s.zip
/
USEREDIT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-07-28
|
12KB
|
425 lines
Uses Dos,Crt;
const maxconf=5;
type
filelisttype=(ffname,ffext,ffsize,ffpoints,ffuploaded,ffuploader,ffdown,
ffdescript,fffulnam,ffofwhat); {Configurable file listings}
configtype=(lowercase,eightycols,linefeeds,postprompts,moreprompts,
asciigraphics,ansigraphics,udsysop,bulletinsysop,votingsysop,
emailsysop,doorssysop,mainsysop,databasesysop,jsysop,
gfsysop,wanted,showtime,vt52,fseditor);
voteset=array [1..10] of byte;
type anystr=string[128];
lstr=string[80];
mstr=string[30];
sstr=string[15];
type userrec=record {Version 1.25}
handle,realname,note:mstr;
macro1,macro2,macro3:lstr;
password:sstr;
phonenum:string[12];
laston:longint;
numon,timetoday,nup,ndn,nbu,uploads,downloads:integer;
totaltime:real; {Total time spent on board}
voted:voteset;
udlevel,udpoints,level,emailannounce,beepedpwd:integer;
infoforms:array[1..5] of integer;
regularcolor,promptcolor,statcolor,inputcolor,fifthcolor,sixthcolor,
seventhcolor,eighthcolor,displaylen:byte;
lastmessages,lastups,lastgfiles,lastdbases,integer1:integer;
downk,upk:longint;
gflevel,gfuploads,gfdownloads:integer;
menutype,byte1:byte;
defproto,char1:char;
hack:byte; {Hack attempts}
config:set of configtype;
newscanconfig,access1,access2:set of byte;
timeinstorage:word;
lastread:array [0..20,1..maxconf] of word;
confaccess: array [0..maxconf] of boolean;
lastcps,cpstimes:word;
filelister:set of filelisttype;
commpoints,valpoints:integer;
quikconf:array[0..maxconf] of boolean;
userpcr,userudr,age:byte;
usersex:boolean; {True=female. Approved by Deanna Elizalda, Feminist}
voteyes,voteno:byte;
timeperday:byte;
end;
Var
Infile :File of Userrec;
UserRecs :Userrec;
Place,a,b,c,d,e:Integer;
Flag :boolean;
Choice :Char;
Counter :Integer;
UserNum :Integer;
Procedure Show_Fields;
Begin
TextColor(9);
Gotoxy(2,2);Write('Handle');
Gotoxy(2,3);Write('User Note');
Gotoxy(2,4);Write('Password');
Gotoxy(2,5);Write('Main Level');
Gotoxy(2,6);Write('File Level');
Gotoxy(2,7);Write('Phone Number');
Gotoxy(2,8);Write('Time Today');
Gotoxy(2,9);Write('File Points');
Gotoxy(2,10);Write('Upload K');
Gotoxy(2,11);Write('Download K');
Gotoxy(2,12);Write('Uploads');
Gotoxy(2,13);Write('Downloads');
Gotoxy(2,14);Write('Gfile Level');
Gotoxy(2,15);Write('Gfile UL''s');
Gotoxy(2,16);Write('Gfile DL''s');
Gotoxy(2,17);Write('Total Time');
Gotoxy(2,18);Write('Real Name')
End;
Procedure Place_Cursor;
Begin
With Userrecs do
Begin
Case Place of
1:begin TextColor(10);Gotoxy(2,2);Write('Handle'); end;
2:begin TextColor(10);Gotoxy(2,3);Write('User Note'); end;
3:begin TextColor(10);Gotoxy(2,4);Write('Password'); end;
4:begin TextColor(10);Gotoxy(2,5);Write('Main Level'); end;
5:begin TextColor(10);Gotoxy(2,6);Write('File Level'); end;
6:begin TextColor(10);Gotoxy(2,7);Write('Phone Number');end;
7:begin TextColor(10);Gotoxy(2,8);Write('Time Today'); end;
8:begin TextColor(10);Gotoxy(2,9);Write('File Points'); end;
9:begin TextColor(10);Gotoxy(2,10);Write('Upload K'); end;
10:begin TextColor(10);Gotoxy(2,11);Write('Download K'); end;
11:begin TextColor(10);Gotoxy(2,12);Write('Uploads'); end;
12:begin TextColor(10);Gotoxy(2,13);Write('Downloads'); end;
13:begin TextColor(10);Gotoxy(2,14);Write('Gfile Level');end;
14:begin TextColor(10);Gotoxy(2,15);Write('Gfile UL''s');end;
15:Begin TextColor(10);Gotoxy(2,16);Write('Gfile DL''s');end;
16:Begin TextColor(10);Gotoxy(2,17);Write('Total Time'); end;
17:Begin TextColor(10);Gotoxy(2,18);Write('Real Name'); end
End
End
End;
Procedure Read_Cursor;
Begin
With Userrecs do
Begin
Case Place of
1:begin TextColor(12);Gotoxy(16,2);Readln(Handle); End;
2:Begin TextColor(12);Gotoxy(16,3);Readln(Note); End;
3:Begin TextColor(12);Gotoxy(16,4);Readln(password); End;
4:Begin TextColor(12);Gotoxy(16,5);Readln(level); End;
5:Begin TextColor(12);Gotoxy(16,6);Readln(udlevel); End;
6:Begin TextColor(12);Gotoxy(16,7);Readln(phonenum); End;
7:Begin TextColor(12);Gotoxy(16,8);Readln(timetoday); End;
8:Begin TextColor(12);Gotoxy(16,9);Readln(udpoints); End;
9:Begin TextColor(12);Gotoxy(16,10);Readln(upk); End;
10:Begin TextColor(12);Gotoxy(16,11);Readln(Downk); End;
11:Begin TextColor(12);Gotoxy(16,12);Readln(uploads); End;
12:Begin TextColor(12);Gotoxy(16,13);Readln(downloads); End;
13:Begin TextColor(12);Gotoxy(16,14);Readln(gflevel); End;
14:Begin TextColor(12);Gotoxy(16,15);Readln(gfuploads); End;
15:Begin TextColor(12);Gotoxy(16,16);Readln(gfdownloads);End;
16:Begin TextColor(12);Gotoxy(16,17);Readln(totaltime); End;
17:Begin TextColor(12);Gotoxy(16,18);Readln(realname); End
End
End
End;
Procedure List_Rec;
Begin
TextColor(4);
Seek(infile,Usernum);
Read(Infile,Userrecs);
Gotoxy(57,15);Write('UserNumber: ',Usernum);
Textcolor(15);
With UserRecs do
Begin
Gotoxy(16,2);Write(Handle);
Gotoxy(16,3);Write(Note);
Gotoxy(16,4);Write(password);
Gotoxy(16,5);Write(level);
Gotoxy(16,6);Write(udlevel);
Gotoxy(16,7);Write(phonenum);
Gotoxy(16,8);Write(timetoday);
Gotoxy(16,9);Write(udpoints);
Gotoxy(16,10);Write(upk);
Gotoxy(16,11);Write(Downk);
Gotoxy(16,12);Write(uploads);
Gotoxy(16,13);Write(downloads);
Gotoxy(16,14);Write(gflevel);
Gotoxy(16,15);Write(gfuploads);
Gotoxy(16,16);Write(gfdownloads);
Gotoxy(16,17);Write(totaltime:6:2);
Gotoxy(16,18);Write(realname)
End
End;
Procedure Open_Rec;
Begin
Assign(Infile,'USERS');
Reset(Infile);
Counter:=0;
While not eof (Infile) do Begin
Read(Infile,userrecs);
Counter:=Counter+1
end;
UserNum:=1
end;
Procedure Write_Rec;
Begin
Seek(Infile,Usernum);
Write(Infile,UserRecs)
End;
Procedure Format_Data_Area;
Begin
For A:=2 to 20 do begin
GotoXy(16,A);Write(' ');
End;
Gotoxy(69,15);Write(' ');
Gotoxy(57,17);Write(' ');
End;
Procedure Delete_Rec;
Begin
With Userrecs do
Begin
Nbu:=0;
Handle:='';
Note:='';
Password:='';
Level:=0;
Udlevel:=0;
Phonenum:='';
TimeToday:=0;
Udpoints:=0;
Upk:=0;
Downk:=0;
Uploads:=0;
Downloads:=0;
Write_Rec;
List_Rec;
Gflevel:=0;
Gfuploads:=0;
Gfdownloads:=0;
TotalTime:=0;
Macro1:=''
end;
Write_Rec;
Format_Data_Area;
List_Rec
End;
Procedure Add_Rec;
Begin
Usernum:=Counter;
Counter:=Counter+1;
GotoXy(57,15);Write('UserNubmer: ',Usernum);
With UserRecs do
Begin
nbu:=0;
Gotoxy(16,2);Readln(Handle);
Gotoxy(16,3);Readln(Note);
Gotoxy(16,4);Readln(password);
Gotoxy(16,5);Readln(level);
Gotoxy(16,6);Readln(udlevel);
Gotoxy(16,7);Readln(phonenum);
Gotoxy(16,8);Readln(timetoday);
Gotoxy(16,9);Readln(udpoints);
Gotoxy(16,10);Readln(upk);
Gotoxy(16,11);Readln(Downk);
Gotoxy(16,12);Readln(uploads);
Gotoxy(16,13);Readln(downloads);
Gotoxy(16,14);Readln(gflevel);
Gotoxy(16,15);Readln(gfuploads);
Gotoxy(16,16);Readln(gfdownloads);
Gotoxy(16,17);Readln(totaltime);
Gotoxy(16,18);Readln(realname)
End;
Seek(Infile,usernum);
Write(Infile,UserRecs)
End;
Begin
ClrScr;
A:=0;
B:=0;
C:=0;
d:=0;
Flag:=False;
TextColor(11);
Gotoxy(1,1);
Write('┌────────────┐');
For A:=2 to 20 do Begin
Gotoxy(1,a);
Write('│ │')
End;
Gotoxy(1,21);
Write('└────────────┘');
TextColor(10);
Gotoxy(15,1);
Write('┌───────────────────────────────────┐');
For A:=2 to 20 do Begin
Gotoxy(15,a);
Write('│ │')
End;
Gotoxy(15,21);
Write('└───────────────────────────────────┘');
Show_Fields;
TextColor(14);
Gotoxy(1,22);
Write('┌');For a:=2 to 79 do Begin
Gotoxy(a,22);
Write('─')
End;
Gotoxy(80,22);
Write('┐');
TextColor(12);
Write(' [Q] Quit [PageUp] Next User [PageDown] Previous User');
TextColor(14);
Gotoxy(1,23);
Write('│');
Gotoxy(80,23);
Write('│');
Gotoxy(1,24);
Write('└');
For a:=2 to 79 do Begin
Gotoxy(a,24);
Write('─')
End;
Gotoxy(80,24);
Write('┘');
TextColor(11);
gotoxy(55,1);
Write('┌─────────────────┐');
For A:=2 to 10 do Begin
Gotoxy(55,a);
Write('│ │')
End;
Gotoxy(55,10);
Write('└─────────────────┘');
TextColor(10);
Gotoxy(57,2);
Write('User Editor');
Gotoxy(57,3);
Write('Courtesy of');
Gotoxy(57,4);
Write('The TCS Folks');
Gotoxy(57,6);
Write(' v1.00 ');
TextColor(13);
Gotoxy(55,11);
Write('┌──────────────────┐');
For A:=12 to 20 do Begin
Gotoxy(55,a);
Write('│ │')
End;
Gotoxy(55,20);
Write('└──────────────────┘');
TextColor(8);
Gotoxy(57,12);
Write('[A] Add User');
Gotoxy(57,13);
Write('[D] Delete User');
Gotoxy(57,19);
Write('[ESC] to Quit');
Open_Rec;
Format_Data_Area;
List_Rec;
Place:=1;
Place_Cursor;
While Flag=False do Begin
Choice:=Readkey;
Choice:=Upcase(Choice);
Case Choice of
'A':Begin
Format_Data_Area;
Add_Rec
End;
'D':Begin
Gotoxy(57,17);
Write('Delete User?');
Choice:=Readkey;
Choice:=Upcase(Choice);
If Choice='Y' then delete_rec else Begin
Gotoxy(57,17);
Write(' ')
End
End;
'Q':Begin
Write_Rec;
Close(Infile);
ClrScr;
Halt
End;
#27:Begin
Write_Rec;
Close(Infile);
ClrScr;
Halt
End;
#13:Read_Cursor;
#0:Begin
Choice:=Readkey;
Case Choice of
#73:Begin
Write_Rec;
Usernum:=Usernum+1;
If Usernum>=counter then Usernum:=1;
Format_Data_Area;
List_Rec
End;
#81:Begin
Write_Rec;
Usernum:=Usernum-1;
If Usernum<1 then usernum:=Counter-1;
Format_Data_Area;
List_Rec
End;
#72:Begin
Place:=Place-1;
if Place<1 then place:=19;
Show_Fields;
Place_Cursor
End;
#80:Begin
Place:=Place+1;
If Place>19 then place:=1;
Show_Fields;
Place_Cursor
End
End
End
End
End
End.
(* Celerity Note -- This user editor is taken almost completely from
TCS - the interface is theirs, etc. Credit where credit is due.
Anyway, feel free to make your own interface etc. out of this. It should
have about all you need. Use Turbo Pascal 5.0 or 5.5. I am in no way
responsible for the inefficiency here. If you do decide to write a new
user editor, please share it with the rest of us.
*)